﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/admin.Master" AutoEventWireup="true" CodeBehind="user_admin.aspx.cs" Inherits="Ciripescu_WebRole.Admin.user_admin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            
    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
    <ContentTemplate>
    
<table width="50%" cellpadding="5">
<tr>
<td>Logs in the last <asp:TextBox ID="PushAge" runat="server" Width="30%" Text="1" />minutes at leve <asp:DropDownList ID="PushLevel" runat="server" Width="20%" ToolTip="Set the minimum level of event to push.">
                    <asp:ListItem>Critical</asp:ListItem>
                    <asp:ListItem>Error</asp:ListItem>
                    <asp:ListItem>Warning</asp:ListItem>
                    <asp:ListItem>Information</asp:ListItem>
                    <asp:ListItem Selected="True">Verbose</asp:ListItem>
                </asp:DropDownList> or above</td>
</tr>
<tr>
<td> <asp:Label ID="TransferErrorMessage" runat="server" ForeColor="Red" Visible="false" /></td>
</tr>
<tr>
<td>
 <div id="TransferSetupPanel" runat="server">
    <asp:Button ID="btnCopyLogs" runat="server" Text="Copy logs" 
        ToolTip="Copy logs on demand" onclick="btnCopyLogs_Click" />
     <asp:Button ID="btnCopyDirectories" runat="server" Text="Copy directories" 
         onclick="btnCopyDirectories_Click" />
        </div>
    <br /><br />
     <div id="TransferProgressPanel" runat="Server" visible="false">
            <p><i>Transferring...</i></p>
            <asp:Timer ID="TransferProgressTimer" runat="server" Interval="1000" OnTick="TransferProgressTimer_Tick" />
        </div>
    
    </td>
</tr>
</table>
</ContentTemplate>
    </asp:UpdatePanel>            
<br />
<hr />

<br />
<h4>Sending test emails to check the worker</h4>
    <asp:UpdatePanel ID="UpdatePanel4" runat="server">
    <ContentTemplate>
    <asp:TextBox ID="txtTestEmail" runat="server"></asp:TextBox>    
    <asp:Button ID="btnSendTestEmail" runat="server" Text="Send" 
            onclick="btnSendTestEmail_Click" />
    <br />
    <asp:Label ID="lblEmailSended" runat="server" Text="Label"></asp:Label>
    </ContentTemplate>
    </asp:UpdatePanel>
    
<hr />
<br />
<table width="50%" cellpadding="5">
    <tr>
        <td>
            <asp:Label ID="Label1" runat="server" Text="Search Users" CssClass="titlu"></asp:Label></td>
    </tr>
    <tr>
        <td class="td_label" width='50%'></td>
        <td class="td_input">
            <div id="mesaje" runat="server" class="error_div"></div>
        </td>
    </tr>
    <tr>
        <td class="td_label" width='50%'>
            <asp:Label ID="Label10" runat="server" 
                Text="Search Type: "></asp:Label></td>
        <td class="td_input">
            <asp:RadioButton ID="Starts_with" runat="server" Checked="True" 
                Text="Starts with" ValidationGroup="search_type" GroupName="search_type" />
            <asp:RadioButton ID="contains" runat="server" Text="Contains" 
                ValidationGroup="search_type" GroupName="search_type" />
            </td>
    </tr>
    <tr>
        <td class="td_label" width='50%'><asp:Label ID="Label8" runat="server" 
                Text="User Type: "></asp:Label></td>
        <td class="td_input">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:DropDownList ID="GroupIdListB" runat="server" CssClass="myinput" 
                        AutoPostBack="True" >
                    </asp:DropDownList>
                </ContentTemplate>
            </asp:UpdatePanel>
            </td>
    </tr>    
    <tr>
        <td class="td_label" width='50%'><asp:Label ID="Label2" runat="server" Text="Username: "></asp:Label></td>
        <td class="td_input"><asp:TextBox ID="UserNameT" runat="server" CssClass="myinput"></asp:TextBox>
            <asp:Button ID="btnSearchByUser" runat="server" Text="Search" 
                onclick="btnSearchByUser_Click" />
        </td>
    </tr>
    <tr>
        <td class="td_label" width='50%'><asp:Label ID="Label9" runat="server" Text="Email: "></asp:Label></td>
        <td class="td_input"><asp:TextBox ID="EmailT" runat="server" CssClass="myinput"></asp:TextBox>
            <asp:Button ID="btnSearchByEmail" runat="server" Text="Search" />
        </td>
    </tr>
    <tr>
        <td class="td_label" width='50%'><asp:Label ID="Label4" runat="server" Text="Account status: "></asp:Label></td>
        <td class="td_input">
            <asp:DropDownList ID="ActivationStatusListB" runat="server" CssClass="myinput" Enabled="false">
                <asp:ListItem Value="0">Any</asp:ListItem>
                <asp:ListItem Value="1">Not Activated</asp:ListItem>
                <asp:ListItem Value="2">Activated</asp:ListItem>
            </asp:DropDownList>
            </td>
    </tr>
    
    <tr>
        <td class="td_label" width='50%'><asp:Label ID="Label3" runat="server" Text="Name: "></asp:Label></td>
        <td class="td_input">
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                    <asp:TextBox ID="NameT" runat="server" CssClass="myinput"></asp:TextBox>
                    <asp:Button ID="btnSearchByName" runat="server" Text="Search" />
                </ContentTemplate>
            </asp:UpdatePanel>
            </td>
    </tr>    
    
    <tr>
        <td colspan="2"><hr /></td>
    </tr>
    <tr>
        <td class="td_label" width='50%'><asp:Label ID="Label5" runat="server" Text="IP: "></asp:Label></td>
        <td class="td_input"><asp:TextBox ID="IPT" runat="server" CssClass="myinput"></asp:TextBox>
            <asp:Button ID="btnSearchByIP" runat="server" Text="Search" />
        </td>
    </tr>
    <tr>
        <td class="td_label">&nbsp;</td>
        <td><asp:Button ID="ResetButton" runat="server" Text="Clear form" 
                CssClass="myinput2" onclick="ResetButton_Click" /></td>
    </tr>
</table>
<br />
    <asp:GridView ID="UsersGridView" runat="server" Width="100%" 
        AutoGenerateColumns="False" CssClass="grid-view" 
        onrowcreated="GridView1_RowCreated">
        <Columns>
            <asp:BoundField DataField="PartitionKey" HeaderText="UserName" />
            <asp:TemplateField>
                <ItemTemplate>
                    <a href='user_details.aspx?UserDataId=<%#Eval("PartitionKey") %>' class="my_link">Edit</a>
                </ItemTemplate>
            </asp:TemplateField>            
            <asp:BoundField DataField="FullName" HeaderText="Full Name" />            
            <asp:BoundField DataField="Email" HeaderText="Email" />
            <asp:TemplateField HeaderText="Group">                
                <ItemTemplate>
                   <%# Eval("Group") %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="IP" HeaderText="IP" />
            <asp:BoundField DataField="LastCirip" HeaderText="Last Cirip" />
            
            <asp:TemplateField>
                <ItemTemplate>
                    <a href='impersonate.aspx?userName=<%#Eval("PartitionKey") %>' class="my_link">Impersonate</a>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</asp:Content>
